/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package py.com.mblj.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author markos
 */
@Entity
@Table(name = "responsables")
@NamedQueries({@NamedQuery(name = "Responsables.findAll", query = "SELECT r FROM Responsables r"), @NamedQuery(name = "Responsables.findByReId", query = "SELECT r FROM Responsables r WHERE r.reId = :reId"), @NamedQuery(name = "Responsables.findByReApellidoNombre", query = "SELECT r FROM Responsables r WHERE r.reApellidoNombre = :reApellidoNombre")})
public class Responsables implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "re_id")
    private Integer reId;
    @Column(name = "re_apellido_nombre")
    private String reApellidoNombre;
    @JoinColumn(name = "re_cargo", referencedColumnName = "cg_id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Cargos reCargo;
    @JoinColumn(name = "re_dependencia", referencedColumnName = "dc_id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Dependencias reDependencia;
    @JoinColumn(name = "re_jerarquia", referencedColumnName = "je_id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Jerarquias reJerarquia;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "deResponsable", fetch = FetchType.LAZY)
    private List<Denuncias> denunciasList;

    public Responsables() {
    }

    public Responsables(Integer reId) {
        this.reId = reId;
    }

    public Integer getReId() {
        return reId;
    }

    public void setReId(Integer reId) {
        this.reId = reId;
    }

    public String getReApellidoNombre() {
        return reApellidoNombre;
    }

    public void setReApellidoNombre(String reApellidoNombre) {
        this.reApellidoNombre = reApellidoNombre;
    }

    public Cargos getReCargo() {
        return reCargo;
    }

    public void setReCargo(Cargos reCargo) {
        this.reCargo = reCargo;
    }

    public Dependencias getReDependencia() {
        return reDependencia;
    }

    public void setReDependencia(Dependencias reDependencia) {
        this.reDependencia = reDependencia;
    }

    public Jerarquias getReJerarquia() {
        return reJerarquia;
    }

    public void setReJerarquia(Jerarquias reJerarquia) {
        this.reJerarquia = reJerarquia;
    }

    public List<Denuncias> getDenunciasList() {
        return denunciasList;
    }

    public void setDenunciasList(List<Denuncias> denunciasList) {
        this.denunciasList = denunciasList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (reId != null ? reId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Responsables)) {
            return false;
        }
        Responsables other = (Responsables) object;
        if ((this.reId == null && other.reId != null) || (this.reId != null && !this.reId.equals(other.reId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.mblj.domain.Responsables[reId=" + reId + "]";
    }

}
